package com.bawei.mdm2207alast.view

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.size
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.navigation.NavController
import androidx.navigation.compose.rememberNavController
import com.bawei.mdm2207alast.R

/**
 * 作者：赵亮
 * 时间：2024/12/16 14:13
 * 功能：欢迎页
 */
@Composable
fun WelcomePage(
    navController: NavController = rememberNavController()
) {

    Box(modifier = Modifier.fillMaxSize()) {
        Column(
            modifier = Modifier.align(Alignment.Center),
            horizontalAlignment = Alignment.CenterHorizontally
        ) {
            // 图片
            Image(
                modifier = Modifier.size(120.dp),
                painter = painterResource(id = R.drawable.img), contentDescription = null
            )
            // 垫片，用来调整距离
            Spacer(modifier = Modifier.height(10.dp))
            // 文字
            Text(text = "MDM", fontSize = 22.sp, fontWeight = FontWeight.Bold)
        }
    }
}

@Preview(showSystemUi = true)
@Composable
fun WelcomePagePreview() {
    WelcomePage()
}

